<template>
    <div>
        <table>
            <tr>
                <td>账号</td>
                <td>
                    <input type="text" v-model="data.zh">
                </td>
            </tr>
            <tr>
                <td>密码</td>
                <td>
                    <input type="password" v-model="data.mm">
                </td>
            </tr>
            <tr>
                <td></td>
                <td>
                    <input type="button" value="登录" @click="dl">
                </td>
            </tr>
        </table>

    </div>
</template>

<script setup lang="ts">
import axios from 'axios';
import { ref } from 'vue';

const data=ref({
    zh:"",
    mm:"",
})

const dl=()=>{
    axios.get("https://localhost:7219/api/we/Logins",{params:data.value}).then(res=>{
        if(res.data==1){
            alert("登录成功")

        }
        if(res.data==-1){
            alert("密码错误")
        }
        if(res.data==-2){
            alert("账号不存在")
        }
    })
}

</script>

<style scoped>

</style>